import {BaseEntity, Column, Entity, Index, JoinColumn, JoinTable, ManyToMany, ManyToOne, OneToMany, OneToOne, PrimaryColumn, PrimaryGeneratedColumn, RelationId} from 'typeorm';

@Entity('tb_token', {schema: 'nest-mall' } )
@Index('token', ['token' ], {unique: true})
export class TbToken {

    @Column('bigint', {
        nullable: false,
        primary: true,
        name: 'user_id',
        })
    userId: string;

    @Column('varchar', {
        nullable: false,
        unique: true,
        length: 100,
        name: 'token',
        })
    token: string;

    @Column('datetime', {
        nullable: true,
        name: 'expire_time',
        })
    expireTime: Date | null;

    @Column('datetime', {
        nullable: true,
        name: 'update_time',
        })
    updateTime: Date | null;

}
